package com.jgy.策略模式;

import lombok.Data;

/**
 * @author 姜光远
 * @date 2022/12/14 16:15
 */
@Data
public class CountPriceContext {
    /**
     * 上下文
     */
    private CountPrice countPrice;

    /**
     * 将对象注入进来
     * @param countPrice
     */
    public CountPriceContext(CountPrice countPrice){
        this.countPrice = countPrice;
    }

    public double Count(double price, int number){
      return   countPrice.getPrice(price,number);
    }
}
